import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm"
import { Department } from "./Department";

@Entity()
export class Employee {
    
    @PrimaryGeneratedColumn()
    id: number;

    @Column({
        length: 50
    })
    name: string;


    @JoinColumn({
        name: 'did'
    })
    //一对多关系(多)
    @ManyToOne(()=>Department)
    department: Department;
}

